Add names to more sources
authorMatthias Clasen <mclasen@redhat.com>
Sun, 13 Aug 2017 13:03:40 +0000 (09:03 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 13 Aug 2017 13:03:40 +0000 (09:03 -0400)
This makes debugging mainloop-related issues more pleasant.

gdk/x11/gdkdnd-x11.c
gtk/gtkentrycompletion.c
gtk/gtkgesturelongpress.c
gtk/gtkgesturemultipress.c
gtk/gtkscrolledwindow.c

index bd3040b1d70ceaf588507bff4fbb359553b776d8..6841d0ad832787cf5ed0845e625915d0ca2044b1 100644 (file)
@@ -2620,6 +2620,7 @@ gdk_x11_drag_context_drop_done (GdkDragContext *context,
   cairo_surface_t *win_surface;
   cairo_surface_t *surface;
   cairo_t *cr;
+  guint id;
 
   if (success)
     {
@@ -2652,9 +2653,10 @@ gdk_x11_drag_context_drop_done (GdkDragContext *context,
   anim->frame_clock = gdk_window_get_frame_clock (x11_context->drag_window);
   anim->start_time = gdk_frame_clock_get_frame_time (anim->frame_clock);
 
-  gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT, 17,
-                                gdk_drag_anim_timeout, anim,
-                                (GDestroyNotify) gdk_drag_anim_destroy);
+  id = gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT, 17,
+                                     gdk_drag_anim_timeout, anim,
+                                     (GDestroyNotify) gdk_drag_anim_destroy);
+  g_source_set_name_by_id (id, "[gtk+] gdk_drag_anim_timeout");
 }
 
 static gboolean
index 6b45e6779043c123d2892fdf81e2642f2db47034..b18616b162fa65c4f7704f069aaeeb61213a6bf4 100644 (file)
@@ -2603,6 +2603,7 @@ completion_insert_text_callback (GtkEntry           *entry,
                             g_cclosure_new_object (G_CALLBACK (check_completion_callback),
                                                    G_OBJECT (completion)));
       g_source_attach (completion->priv->check_completion_idle, NULL);
+      g_source_set_name (completion->priv->check_completion_idle, "[gtk+] check_completion_callback");
     }
 }
 
index 8cbcce76e7b8568ac37d43ad041799221b0830e7..de4ff7994f6691f6d326fe2890945c62e92fcabf 100644 (file)
@@ -137,10 +137,8 @@ gtk_gesture_long_press_begin (GtkGesture       *gesture,
 
   gtk_gesture_get_point (gesture, sequence,
                          &priv->initial_x, &priv->initial_y);
-  priv->timeout_id =
-    gdk_threads_add_timeout (delay,
-                             _gtk_gesture_long_press_timeout,
-                             gesture);
+  priv->timeout_id = gdk_threads_add_timeout (delay, _gtk_gesture_long_press_timeout, gesture);
+  g_source_set_name_by_id (priv->timeout_id, "[gtk+] _gtk_gesture_long_press_timeout");
 }
 
 static void
index c61273569a6d1e9fbba17e6f6afcbf89a7355d40..e0816cf80887567d14adf0ac553efab811aaf6f3 100644 (file)
@@ -150,10 +150,10 @@ _gtk_gesture_multi_press_update_timeout (GtkGestureMultiPress *gesture)
   settings = gtk_widget_get_settings (widget);
   g_object_get (settings, "gtk-double-click-time", &double_click_time, NULL);
 
-  priv->double_click_timeout_id =
-    gdk_threads_add_timeout (double_click_time,
-                             _double_click_timeout_cb,
-                             gesture);
+  priv->double_click_timeout_id = gdk_threads_add_timeout (double_click_time,
+                                                           _double_click_timeout_cb,
+                                                           gesture);
+  g_source_set_name_by_id (priv->double_click_timeout_id, "[gtk+] _double_click_timeout_cb");
 }
 
 static gboolean
index 5310eace71442b182001a2a4681991c938b84e38..f791303e7c9a29d32f190557beb675742ce2eb04 100644 (file)
@@ -1148,7 +1148,10 @@ check_update_scrollbar_proximity (GtkScrolledWindow *sw,
   if (on_scrollbar)
     indicator_set_over (indicator, TRUE);
   else if (indicator_close && !on_other_scrollbar)
-    indicator->over_timeout_id = gdk_threads_add_timeout (30, enable_over_timeout_cb, indicator);
+    {
+      indicator->over_timeout_id = gdk_threads_add_timeout (30, enable_over_timeout_cb, indicator);
+      g_source_set_name_by_id (indicator->over_timeout_id, "[gtk+] enable_over_timeout_cb");
+    }
   else
     indicator_set_over (indicator, FALSE);
 
@@ -3759,7 +3762,9 @@ indicator_set_fade (Indicator *indicator,
 
   if (visible)
     {
+if (indicator->conceil_timer != 0) g_print ("leaking conceil_timer!\n");
       indicator->conceil_timer = g_timeout_add (INDICATOR_FADE_OUT_TIME, maybe_hide_indicator, indicator);
+      g_source_set_name_by_id (indicator->conceil_timer, "[gtk+] maybe_hide_indicator");
     }
   if (!visible && gtk_widget_get_mapped (indicator->scrollbar) &&
       indicator->conceil_timer != 0)